﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for TransferAZCP

/// Table Name : [TransferAZCP]
/// Created By : CX
/// Created Date : Tuesday, May 03, 2011
/// </summary>
/// 
namespace CE.Transfer
{

    public class TransferAZCPDB
    {
        public TransferAZCPDB()
        {	//TODO: Add constructor logic here

        }

        public Int64 Insert(TransferAZCP transfer)
		{
			MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocInsert]";
			
			SortedList _sPara = new SortedList();
			
			#region Parameter			
            _sPara.Add("@Insured_type", transfer.Insured_type);
            _sPara.Add("@Insured_title", transfer.Insured_title);
            _sPara.Add("@Insured_title_text", transfer.Insured_title_text);
            _sPara.Add("@Insured_fname", transfer.Insured_fname);
            _sPara.Add("@Insured_lname", transfer.Insured_lname);
            _sPara.Add("@Insured_company_prefix", transfer.Insured_company_prefix);
            _sPara.Add("@Insured_company_name", transfer.Insured_company_name);
            _sPara.Add("@Insured_company_suffix", transfer.Insured_company_suffix);
            _sPara.Add("@Customer_name_Text", transfer.Customer_name_Text);
            _sPara.Add("@Insured_Address1", transfer.Insured_Address1);
            _sPara.Add("@Insured_Address2", transfer.Insured_Address2);
            _sPara.Add("@Insured_Address3", transfer.Insured_Address3);
            _sPara.Add("@Insured_Address4", transfer.Insured_Address4);
            _sPara.Add("@Insured_Address5", transfer.Insured_Address5);
            _sPara.Add("@Insured_Amphor_code", transfer.Insured_Amphor_code);
            _sPara.Add("@Insured_Province_code", transfer.Insured_Province_code);
            _sPara.Add("@Insured_post_code", transfer.Insured_post_code);
            _sPara.Add("@Insured_Contact_tel", transfer.Insured_Contact_tel);
            _sPara.Add("@Insured_business_tel", transfer.Insured_business_tel);
            _sPara.Add("@Insured_Mobile_tel", transfer.Insured_Mobile_tel);
            _sPara.Add("@Insured_fax", transfer.Insured_fax);
            _sPara.Add("@Insured_gender", transfer.Insured_gender);
            _sPara.Add("@Insured_occu", transfer.Insured_occu);
            _sPara.Add("@Insured_id_card", transfer.Insured_id_card);
            _sPara.Add("@Cnt_Insured_name", transfer.Cnt_Insured_name);
            _sPara.Add("@Cnt_Insured_Address1", transfer.Cnt_Insured_Address1);
            _sPara.Add("@Cnt_Insured_Address2", transfer.Cnt_Insured_Address2);
            _sPara.Add("@Cnt_Insured_Address3", transfer.Cnt_Insured_Address3);
            _sPara.Add("@Cnt_Insured_Address4", transfer.Cnt_Insured_Address4);
            _sPara.Add("@Cnt_Insured_Amphor_code", transfer.Cnt_Insured_Amphor_code);
            _sPara.Add("@Cnt_Insured_Province_code", transfer.Cnt_Insured_Province_code);
            _sPara.Add("@Cnt_Insured_post_code", transfer.Cnt_Insured_post_code);
            _sPara.Add("@Cnt_Insured_Contact_tel", transfer.Cnt_Insured_Contact_tel);
            _sPara.Add("@Payer_type", transfer.Payer_type);
            _sPara.Add("@Payer_title", transfer.Payer_title);
            _sPara.Add("@Payer_title_text", transfer.Payer_title_text);
            _sPara.Add("@Payer_fname", transfer.Payer_fname);
            _sPara.Add("@Payer_lname", transfer.Payer_lname);
            _sPara.Add("@Payer_company_prefix", transfer.Payer_company_prefix);
            _sPara.Add("@Payer_company_name", transfer.Payer_company_name);
            _sPara.Add("@Payer_company_suffix", transfer.Payer_company_suffix);
            _sPara.Add("@Payer_Address1", transfer.Payer_Address1);
            _sPara.Add("@Payer_Address2", transfer.Payer_Address2);
            _sPara.Add("@Payer_Address3", transfer.Payer_Address3);
            _sPara.Add("@Payer_Address4", transfer.Payer_Address4);
            _sPara.Add("@Payer_Address5", transfer.Payer_Address5);
            _sPara.Add("@Payer_Amphor_code", transfer.Payer_Amphor_code);
            _sPara.Add("@Payer_Province_code", transfer.Payer_Province_code);
            _sPara.Add("@Payer_post_code", transfer.Payer_post_code);
            _sPara.Add("@Payer_Contact_tel", transfer.Payer_Contact_tel);
            _sPara.Add("@Payer_business_tel", transfer.Payer_business_tel);
            _sPara.Add("@Payer_Mobile_tel", transfer.Payer_Mobile_tel);
            _sPara.Add("@Payer_fax", transfer.Payer_fax);
            _sPara.Add("@Payer_gender", transfer.Payer_gender);
            _sPara.Add("@Payer_id_card", transfer.Payer_id_card);
            _sPara.Add("@Payer_creiditCard_No", transfer.Payer_creiditCard_No);
            _sPara.Add("@Payer_creditCard_type", transfer.Payer_creditCard_type);
            _sPara.Add("@Credit_card_expiry_date", transfer.Credit_card_expiry_date);
            _sPara.Add("@Credit_card_Holder_Name", transfer.Credit_card_Holder_Name);
            _sPara.Add("@Bene_type", transfer.Bene_type);
            _sPara.Add("@Bene_code", transfer.Bene_code);
            _sPara.Add("@Bene_title", transfer.Bene_title);
            _sPara.Add("@Bene_title_text", transfer.Bene_title_text);
            _sPara.Add("@Bene_fname", transfer.Bene_fname);
            _sPara.Add("@Bene_lname", transfer.Bene_lname);
            _sPara.Add("@Bene_company_prefix", transfer.Bene_company_prefix);
            _sPara.Add("@Bene_company_name", transfer.Bene_company_name);
            _sPara.Add("@Bene_company_suffix", transfer.Bene_company_suffix);
            _sPara.Add("@Bene_Address1", transfer.Bene_Address1);
            _sPara.Add("@Bene_Address2", transfer.Bene_Address2);
            _sPara.Add("@Bene_Address3", transfer.Bene_Address3);
            _sPara.Add("@Bene_Address4", transfer.Bene_Address4);
            _sPara.Add("@Bene_Address5", transfer.Bene_Address5);
            _sPara.Add("@Bene_Amphor_code", transfer.Bene_Amphor_code);
            _sPara.Add("@Bene_Province_code", transfer.Bene_Province_code);
            _sPara.Add("@Bene_post_code", transfer.Bene_post_code);
            _sPara.Add("@Bene_Contact_tel", transfer.Bene_Contact_tel);
            _sPara.Add("@Bene_business_tel", transfer.Bene_business_tel);
            _sPara.Add("@Bene_Mobile_tel", transfer.Bene_Mobile_tel);
            _sPara.Add("@Bene_fax", transfer.Bene_fax);
            _sPara.Add("@Bene_gender", transfer.Bene_gender);
            _sPara.Add("@Drv1_title", transfer.Drv1_title);
            _sPara.Add("@Drv1_title_text", transfer.Drv1_title_text);
            _sPara.Add("@Drv1_fname", transfer.Drv1_fname);
            _sPara.Add("@Drv1_lname", transfer.Drv1_lname);
            _sPara.Add("@Drv1_Address1", transfer.Drv1_Address1);
            _sPara.Add("@Drv1_Address2", transfer.Drv1_Address2);
            _sPara.Add("@Drv1_Address3", transfer.Drv1_Address3);
            _sPara.Add("@Drv1_Address4", transfer.Drv1_Address4);
            _sPara.Add("@Drv1_Address5", transfer.Drv1_Address5);
            _sPara.Add("@Drv1_Amphor_code", transfer.Drv1_Amphor_code);
            _sPara.Add("@Drv1_Province_code", transfer.Drv1_Province_code);
            _sPara.Add("@Drv1_post_code", transfer.Drv1_post_code);
            _sPara.Add("@Drv1_Contact_tel", transfer.Drv1_Contact_tel);
            _sPara.Add("@Drv1_business_tel", transfer.Drv1_business_tel);
            _sPara.Add("@Drv1_Mobile_tel", transfer.Drv1_Mobile_tel);
            _sPara.Add("@Drv1_fax", transfer.Drv1_fax);
            _sPara.Add("@Drv1_gender", transfer.Drv1_gender);
            _sPara.Add("@Drv1_birth_date", transfer.Drv1_birth_date);
            _sPara.Add("@Drv1_licenseNo", transfer.Drv1_licenseNo);
            _sPara.Add("@Drv1_LicenseExp_date", transfer.Drv1_LicenseExp_date);
            _sPara.Add("@Drv1_id", transfer.Drv1_id);
            _sPara.Add("@Drv2_title", transfer.Drv2_title);
            _sPara.Add("@Drv2_title_text", transfer.Drv2_title_text);
            _sPara.Add("@Drv2_fname", transfer.Drv2_fname);
            _sPara.Add("@Drv2_lname", transfer.Drv2_lname);
            _sPara.Add("@Drv2_Address1", transfer.Drv2_Address1);
            _sPara.Add("@Drv2_Address2", transfer.Drv2_Address2);
            _sPara.Add("@Drv2_Address3", transfer.Drv2_Address3);
            _sPara.Add("@Drv2_Address4", transfer.Drv2_Address4);
            _sPara.Add("@Drv2_Address5", transfer.Drv2_Address5);
            _sPara.Add("@Drv2_Amphor_code", transfer.Drv2_Amphor_code);
            _sPara.Add("@Drv2_Province_code", transfer.Drv2_Province_code);
            _sPara.Add("@Drv2_post_code", transfer.Drv2_post_code);
            _sPara.Add("@Drv2_Contact_tel", transfer.Drv2_Contact_tel);
            _sPara.Add("@Drv2_business_tel", transfer.Drv2_business_tel);
            _sPara.Add("@Drv2_Mobile_tel", transfer.Drv2_Mobile_tel);
            _sPara.Add("@Drv2_fax", transfer.Drv2_fax);
            _sPara.Add("@Drv2_gender", transfer.Drv2_gender);
            _sPara.Add("@Drv2_birth_date", transfer.Drv2_birth_date);
            _sPara.Add("@Drv2_licenseNo", transfer.Drv2_licenseNo);
            _sPara.Add("@Drv2_LicenseExp_date", transfer.Drv2_LicenseExp_date);
            _sPara.Add("@Drv2_id", transfer.Drv2_id);
            _sPara.Add("@Vmi_start_date", transfer.Vmi_start_date);
            _sPara.Add("@Vmi_end_date", transfer.Vmi_end_date);
            _sPara.Add("@Vmi_calculate_flag", transfer.Vmi_calculate_flag);
            _sPara.Add("@VmiVehType", transfer.VmiVehType);
            _sPara.Add("@Brand_code", transfer.Brand_code);
            _sPara.Add("@Model_code", transfer.Model_code);
            _sPara.Add("@License_no", transfer.License_no);
            _sPara.Add("@License_province", transfer.License_province);
            _sPara.Add("@Engine_no", transfer.Engine_no);
            _sPara.Add("@Chassis_no", transfer.Chassis_no);
            _sPara.Add("@CC", transfer.CC);
            _sPara.Add("@No_of_Seat", transfer.No_of_Seat);
            _sPara.Add("@Weight", transfer.Weight);
            _sPara.Add("@Model_year", transfer.Model_year);
            _sPara.Add("@Body_code", transfer.Body_code);
            _sPara.Add("@Cover_type", transfer.Cover_type);
            _sPara.Add("@Package_code", transfer.Package_code);
            _sPara.Add("@Vmi_Suminsured", transfer.Vmi_Suminsured);
            _sPara.Add("@OD_DEDUCTIBLE", transfer.OD_DEDUCTIBLE);
            _sPara.Add("@TPPD_DEDUCTIBLE", transfer.TPPD_DEDUCTIBLE);
            _sPara.Add("@COLLISION_DEDUCTIBLE", transfer.COLLISION_DEDUCTIBLE);
            _sPara.Add("@Accessory_code1", transfer.Accessory_code1);
            _sPara.Add("@Accessory_Remark1", transfer.Accessory_Remark1);
            _sPara.Add("@Accessory_Sum1", transfer.Accessory_Sum1);
            _sPara.Add("@Accessory_code2", transfer.Accessory_code2);
            _sPara.Add("@Accessory_Remark2", transfer.Accessory_Remark2);
            _sPara.Add("@Accessory_Sum2", transfer.Accessory_Sum2);
            _sPara.Add("@Accessory_code3", transfer.Accessory_code3);
            _sPara.Add("@Accessory_Remark3", transfer.Accessory_Remark3);
            _sPara.Add("@Accessory_Sum3", transfer.Accessory_Sum3);
            _sPara.Add("@Accessory_code4", transfer.Accessory_code4);
            _sPara.Add("@Accessory_Remark4", transfer.Accessory_Remark4);
            _sPara.Add("@Accessory_Sum4", transfer.Accessory_Sum4);
            _sPara.Add("@Accessory_code5", transfer.Accessory_code5);
            _sPara.Add("@Accessory_Remark5", transfer.Accessory_Remark5);
            _sPara.Add("@Accessory_Sum5", transfer.Accessory_Sum5);
            _sPara.Add("@NCB_Percent", transfer.NCB_Percent);
            _sPara.Add("@Fleet_Code", transfer.Fleet_Code);
            _sPara.Add("@Fleet_Percent", transfer.Fleet_Percent);
            _sPara.Add("@Red_plate_discount", transfer.Red_plate_discount);
            _sPara.Add("@DIRECT_DISCOUNT_GROUP", transfer.DIRECT_DISCOUNT_GROUP);
            _sPara.Add("@DIRECT_DISCOUNT_VMI_PERC", transfer.DIRECT_DISCOUNT_VMI_PERC);
            _sPara.Add("@DIRECT_DISCOUNT_CMI_PERC", transfer.DIRECT_DISCOUNT_CMI_PERC);
            _sPara.Add("@GPS_Amount", transfer.GPS_Amount);
            _sPara.Add("@CmiVehType", transfer.CmiVehType);
            _sPara.Add("@Cmi_start_date", transfer.Cmi_start_date);
            _sPara.Add("@Cmi_End_date", transfer.Cmi_End_date);
            _sPara.Add("@Vmi_Premium", transfer.Vmi_Premium);
            _sPara.Add("@Vmi_stamp", transfer.Vmi_stamp);
            _sPara.Add("@Vmi_vat", transfer.Vmi_vat);
            _sPara.Add("@Vmi_total", transfer.Vmi_total);
            _sPara.Add("@Cmi_Premium", transfer.Cmi_Premium);
            _sPara.Add("@Cmi_stamp", transfer.Cmi_stamp);
            _sPara.Add("@Cmi_vat", transfer.Cmi_vat);
            _sPara.Add("@Cmi_total", transfer.Cmi_total);
            _sPara.Add("@Intermediary_id", transfer.Intermediary_id);
            _sPara.Add("@User", transfer.User);
            _sPara.Add("@Campaign_code", transfer.Campaign_code);
            _sPara.Add("@Campaign_sub_code", transfer.Campaign_sub_code);
            _sPara.Add("@Cmi_Policy_no", transfer.Cmi_Policy_no);
            _sPara.Add("@Vmi_Policy_no", transfer.Vmi_Policy_no);
            _sPara.Add("@Business_unit_code", transfer.Business_unit_code);
            _sPara.Add("@Billing_plan", transfer.Billing_plan);
            _sPara.Add("@Paymentmethod", transfer.Paymentmethod);
            _sPara.Add("@CMIYN", transfer.CMIYN);
            _sPara.Add("@VMIYN", transfer.VMIYN);
            _sPara.Add("@AO_MEMBER", transfer.AO_MEMBER);
            _sPara.Add("@Success_date", transfer.Success_date);
            _sPara.Add("@Remarks", transfer.Remarks);
            _sPara.Add("@Refer_Policy_No", transfer.Refer_Policy_No);
            _sPara.Add("@Refer_Insurance_company", transfer.Refer_Insurance_company);
            _sPara.Add("@Refer_check_claim_name", transfer.Refer_check_claim_name);
            _sPara.Add("@BRANCH_CODE", transfer.BRANCH_CODE);

            #endregion
			
            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
		}

        public bool Update()
        {
            return true;
        }

        public bool Delete(Int64 id)
		{
			MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocDelete]";
			
			SortedList _sPara = new SortedList();	
			

            #region Parameter
            //_sPara.Add("@ID", id);
            //_sPara.Add("@ID2", id2);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result > 0;			
		}

    }



}



